package de.baumann.browser.adapter

import android.os.Parcelable
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter
import de.baumann.browser.iview.IBaseView
import java.util.ArrayList

class PagerAdapter(fm: FragmentManager?, private var fmList: List<Fragment>, var titles: Array<String>?) : FragmentStatePagerAdapter(fm) {

    override fun getCount(): Int {
        return fmList.size
    }

    override fun getItem(position: Int): Fragment {
        return fmList[position]
    }

    override fun getPageTitle(position: Int): CharSequence? {
        if (titles == null) {
            return ""
        }
        return titles!![position]
    }

    override fun saveState(): Parcelable? {
        return null
    }

}